import request from '@/utils/request'

export const SiteParamType = {
  SITE_NAME: 'SITE_NAME',
  SITE_LOGO: 'SITE_LOGO',
  SITE_DESC: 'SITE_DESC'
}

/**
 * 获取系统参数
 * @param {string} type 参数类型
 * @returns {Promise}
 */
export function getParam(type) {
  return request({
    url: '/setting/param',
    method: 'get',
    params: { type }
  })
}

/**
 * 更新系统参数
 * @param {Object} data 参数数据
 * @returns {Promise}
 */
export function updateParam(data) {
  return request({
    url: '/api/setting/param',
    method: 'put',
    data
  })
}